﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using TMS_BackEnd.IServices.Shen;
using TMS_BackEnd.Models.SH;

namespace TMS_BackEnd.Controllers.Shen
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class Sys_menuController : ControllerBase
    {
        public ISys_menuService sys_MenuService { get; set; }  

        [HttpGet]
        public List<sys_menu> Get_Menus()
        {
            return sys_MenuService.Get_Menus();
        }

        [HttpPost]
        public int Add_Menus(sys_menu sys_Menu)
        {
            return sys_MenuService.AddSys_menu(sys_Menu);
        }

        [HttpPut]
        public int Update_Menu(sys_menu sys_Menu)
        {
            return sys_MenuService.UpdateSys_menu(sys_Menu);
        }

        [HttpDelete]
        public int Delete_Menu(int menu_id)
        {
            return sys_MenuService.DelteSys_menu(menu_id);
        }
    }
}
